
"""
Created on Tue Feb 19 14:55:43 2013

@author: aponteeduarddo@gmail.com
Copyright Eduardo Aponte 2013.
"""

from mex_binder import binder_py

eyelink_event_data_flags = binder_py('mx_eyelink_event_data_flags')
eyelink_event_data_flags.mx_c.headers = ['<eyelink.h>','"mex.h"']
eyelink_event_data_flags.bindo += []
eyelink_event_data_flags.mx_c.code = \
"""
INT16 _main( void )
{
    return eyelink_event_data_flags( ); ;
}

void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
    mwSize td[2] = {1,1};
    double *status;
    
    /* Verify input arguments. */
    if(nrhs != 0 ) {
        mexErrMsgTxt("Incorrect number of inputs.");
    } else if( nlhs > 1 ) {
        mexErrMsgTxt("Too many output arguments.");
    }
    plhs[0] = mxCreateNumericArray( 2, td, mxDOUBLE_CLASS, mxREAL);
    status = mxGetPr(plhs[0]);    
    *status = (double ) _main( );
    return;
}
"""

eyelink_event_data_flags.mx_c.mdoc = \
"""function [ status ] = mx_eyelink_event_data_flags( void )
%MX_EYELINK_EVENT_DATA_FLAGS Returns the event data content flags.
%
% Remarks:
% This will be 0 if the data being read from queue is not in a block with events.
% Returns:
% Event data content flags: EVENT_VELOCITY if has velocity data. EVENT_PUPILSIZE 
% if has pupil size data. EVENT_GAZERES if has gaze resolution. EVENT_STATUS 
% if has status flags. EVENT_GAZEXY if has gaze xy position. EVENT_HREFXY if 
% has head-ref xy position. EVENT_PUPILXY if has pupil xy position. FIX_AVG_ONLY
% if only avg. data to fixation events. START_TIME_ONLY if only start-time in
% start events. PARSEDBY_GAZE if how events were generated. PARSEDBY_HREF. 
% PARSEDBY_PUPIL.
%
% EVENT_VELOCITY  0x8000  /*!< has velocity data */
% EVENT_PUPILSIZE 0x4000  /*!< has pupil size data */
% EVENT_GAZERES   0x2000  /*!< has gaze resolution */
% EVENT_STATUS    0x1000  /*!< has status flags */
%
% EVENT_GAZEXY    0x0400  /*!< has gaze xy position */
% EVENT_HREFXY    0x0200  /*!< has head-ref xy position */
% EVENT_PUPILXY   0x0100  /*!< has pupil xy position */
%
% FIX_AVG_ONLY    0x0008  /*!< only avg. data to fixation evts */
% START_TIME_ONLY 0x0004  /*!< only start-time in start events */
%
% PARSEDBY_GAZE   0x00C0  /*!< events were generated using GAZE*/
% PARSEDBY_HREF   0x0080  /*!< events were generated using HREF*/
% PARSEDBY_PUPIL  0x0040  /*!< events were generated using PUPIL*/
%
"""
eyelink_event_data_flags.write_c()
eyelink_event_data_flags.write_m()
eyelink_event_data_flags.compile()
eyelink_event_data_flags.write_sh()

